#include <iostream>
#include <exception>
using namespace std;

class myexception: public exception
{
  virtual const char* what() const throw()
  {
    return "My exception happened";
  }
};

int main () {
  try
  {
    int i;
    cin >> i;
    if (i>0)
    throw new myexception;
    else throw *(new myexception);
  }
  catch (exception* ep)
  {
    cout << ep->what() << endl;
  }
  
  catch(exception& e) {
    cout << "get a negative integer!! " << e.what() << endl;
  } 
  return 0;
}
